const jwt = require("jsonwebtoken");

//密钥

const privatekey = "@@@DDD9995886***33"


//token加密
function sign(data, time) {
  return jwt.sign(
    {
      data
    },
    privatekey,
    { expiresIn: time }
  );
}


//解析
function verify(token) {
  return jwt.verify(token, privatekey)
}


module.exports = {
  sign,
  verify
} 